<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>题目管理管理</title>
	<meta name="decorator" content="default"/>
    <style type="text/css">
        .question {
            margin: 30px 10px;
            outline: 2px dimgrey dashed;
        }
    </style>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/teaching/question/">题目管理列表</a></li>
		<shiro:hasPermission name="teaching:course:edit"><li><a href="${ctx}/teaching/question/form">题目管理添加</a></li></shiro:hasPermission>
	</ul>
	<sys:message content="${message}"/>
    <h1>${library.name}</h1>
    <form action="" method="post" style="margin-bottom: 200px;">
        <div id="content">
            <ol>
                <c:forEach items="${page.list}" var="question">
                    <div class="question">
                        <li>
                            <span class="badge" title="题目序号,题目类型">
                            ${question.no},
                                <c:if test="${question.ctype eq 'single'}">
                                    单选
                                </c:if>
                                <c:if test="${question.ctype eq 'multiple'}">
                                    多选
                                </c:if>
                                <c:if test="${question.ctype eq 'judgments'}">
                                    判断
                                </c:if>
                            </span>

                            <textarea rows="2" style="width: 50%;">${question.content}</textarea>

                            <span class="badge" title="题目编号,全平台唯一">${question.id}</span>
                        </li>
                        <c:forEach items="${question.answerList}" var="answer">
                            <div>
                                <c:if test="${question.ctype eq 'single'}">
                                    <input type="radio"
                                           <c:if test="${answer.correct == 1}">checked="checked"</c:if>
                                           name="${question.id}"
                                           id="${question.id}-${answer.id}"/>
                                </c:if>
                                <c:if test="${question.ctype eq 'multiple'}">
                                    <input type="checkbox"
                                           <c:if test="${answer.correct == 1}">checked="checked"</c:if>
                                           name="${question.id}"
                                           id="${question.id}-${answer.id}"/>
                                </c:if>
                                <c:if test="${question.ctype eq 'judgments'}">
                                    <input type="radio"
                                           <c:if test="${answer.correct == 1}">checked="checked"</c:if>
                                           name="${question.id}"
                                           id="${question.id}-${answer.id}"/>
                                </c:if>
                                <label for="${question.id}-${answer.id}">
                                    <span class="label label-primary">${answer.subOption}</span>

                                    <input type="text" value="${answer.content}"/>

                                    <span class="badge" title="答案编号,全平台唯一">${answer.id}</span>
                                </label>
                            </div>
                        </c:forEach>
                        <div class="well well-sm">
                            <div class="form-group">
                                <label for="analysis">题目解析:</label>
                                <textarea class="form-control" rows="3" id="analysis" style="width: 100%;">${question.analysis}</textarea>
                            </div>
                        </div>
                    </div>
                </c:forEach>
            </ol>
        </div>
    </form>
    <div class="well well-lg" style=" position: fixed; bottom: 0; left: 20px; right: 20px;">
        <button type="button" class="btn btn-primary btn-block" style="height: 50px;">保存</button>
    </div>
</body>
</html>